package com.hyper_yang.javase.supplement.tryEnum.enumBefore;

// jdk 1.5之前 单独创建类维护枚举值
public class Gender {
    public final static Gender MAN = new Gender('男');
    public final static Gender WOMAN = new Gender('女');

    private char gender;

    // TODO 构造器私有化
    private Gender(char gender) {
        this.gender = gender;
    }

    // 没重写输出 地址 重写输出 gender属性值
    @Override
    public String toString() {
        return "'" + gender + "'";
    }
}
